﻿/*using Genealogy;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 电子族谱管理系统
{
    public partial class 族谱管理界面 : Form
    {
        public 族谱管理界面()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            String str1 = 族谱ID.Text;       //获取内容；
            String str2 = 管理员.Text;
            String str3 = 族谱简介.Text;
            String str4 = "insert into [genealogy] values('" + str1 + "','" + str2 + "','" + str3 + "','" + str4 + "')"; 
            gene r2 = new gene(); 
            int d2 = r2.ExecuteUpdate(str5);   
            if (d2 != 0)
            {
                MessageBox.Show("新建成功！", "新建结果",
                        MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("信息错误，\n请重新输入！", "新建结果",
                    MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            String str1 = ChangeID.Text;       
            String str2 = 管理员.Text;
            String str3 = 族谱简介.Text;
            String str4 = "UPDATE [genealogy] SET Last_name='" + str2 + "',patriarch='" + str3 + "',introduction='" + str4 + "' WHERE genealogy_ID='" + str1 + "'";   
            int flag = r2.ExecuteUpdate(str5);   
            {
                MessageBox.Show("修改成功！", "修改结果",
                        MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("信息错误，\n请重新输入！", "修改结果",
                    MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
            }
        }

        private void button6_Click(object sender, EventArgs e)
        {
            String str1 = DelGen.Text;
            String str2 = "DELETE FROM [genealogy] WHERE genealogy_ID = '" + str1 + "'";
            gene r2 = new gene();   //连接数据库
            if (d2 != 0)
            {
                MessageBox.Show("确认删除族谱吗？", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
            }
            else
            {
                MessageBox.Show("删除错误!\n", "删除结果",)
                    MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
            }
        }

        private void 族谱ID_TextChanged(object sender, EventArgs e)
        {

        }

        private void 修改族谱_Click(object sender, EventArgs e)
        {

        }

        private void 族谱号2_TextChanged(object sender, EventArgs e)
        {

        }

        private void 删除族谱_Click(object sender, EventArgs e)
        {

        }

        private void tabControl1_Click(object sender, EventArgs e)
        {
            String str1 = 登录界面.form1.登录账号.Text;
            String str2 = "select genealogy_ID from [User] WHERE User_ID='" + str1 + "'";
            gene r1 = new gene();   
            DataTable flag0 = new DataTable();
            flag0 = r1.ExecuteQuery(str2); 
            if (flag0 != null && flag0.Rows.Count > 0)
            {
                ChangeID.Text = flag0.Rows[0]["genealogy_ID"].ToString();
                DelGen.Text = flag0.Rows[0]["genealogy_ID"].ToString();
            }
        }
        private void quxiao_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void quxiao2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void quxiao3_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void 族谱管理界面_Load(object sender, EventArgs e)
        {


        }

        private void label15_Click(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {
            String str1 = 登录界面.form1.登录账号.Text;
            String str2 = "select genealogy_ID from [User] WHERE User_ID='" + str1 + "'";
            gene r1 = new gene();  
            DataTable flag0 = new DataTable(); 
            flag0 = r1.ExecuteQuery(str2);      
            if (flag0 != null && flag0.Rows.Count > 0)
            {
                ChangeID.Text = flag0.Rows[0]["genealogy_ID"].ToString();
                DelGen.Text = flag0.Rows[0]["genealogy_ID"].ToString();
        }

        private void InitializeComponent()
        {
            this.新建族谱 = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
            this.新建文件ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.打开文件ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.退出系统ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.menuStrip1.SuspendLayout();
            this.SuspendLayout();
            // 
            // 新建族谱
            // 
            this.新建族谱.Location = new System.Drawing.Point(106, 64);
            this.新建族谱.Name = "新建族谱";
            this.新建族谱.Size = new System.Drawing.Size(75, 23);
            this.新建族谱.TabIndex = 0;
            this.新建族谱.Text = "button1";
            this.新建族谱.UseVisualStyleBackColor = true;
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(49, 107);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(41, 12);
            this.label1.TabIndex = 1;
            this.label1.Text = "label1";
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(282, 86);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(41, 12);
            this.label2.TabIndex = 2;
            this.label2.Text = "label2";
            // 
            // menuStrip1
            // 
            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.新建文件ToolStripMenuItem,
            this.打开文件ToolStripMenuItem,
            this.退出系统ToolStripMenuItem});
            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
            this.menuStrip1.Name = "menuStrip1";
            this.menuStrip1.Size = new System.Drawing.Size(498, 25);
            this.menuStrip1.TabIndex = 3;
            this.menuStrip1.Text = "menuStrip1";
            // 
            // 新建文件ToolStripMenuItem
            // 
            this.新建文件ToolStripMenuItem.Name = "新建文件ToolStripMenuItem";
            this.新建文件ToolStripMenuItem.Size = new System.Drawing.Size(68, 21);
            this.新建文件ToolStripMenuItem.Text = "新建文件";
            // 
            // 打开文件ToolStripMenuItem
            // 
            this.打开文件ToolStripMenuItem.Name = "打开文件ToolStripMenuItem";
            this.打开文件ToolStripMenuItem.Size = new System.Drawing.Size(68, 21);
            this.打开文件ToolStripMenuItem.Text = "打开文件";
            // 
            // 退出ToolStripMenuItem
            // 
            this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
            this.退出ToolStripMenuItem.Size = new System.Drawing.Size(44, 21);
            this.退出ToolStripMenuItem.Text = "退出";
            this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click);
            // 
            // 族谱管理界面
            // 
            this.ClientSize = new System.Drawing.Size(498, 273);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.新建族谱);
            this.Controls.Add(this.menuStrip1);
            this.MainMenuStrip = this.menuStrip1;
            this.Name = "族谱管理界面";
            this.Load += new System.EventHandler(this.族谱管理界面_Load_1);
            this.menuStrip1.ResumeLayout(false);
            this.menuStrip1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        private void 族谱管理界面_Load_1(object sender, EventArgs e)
        {

        }

        private Button 新建族谱;
        private Label label1;
        private Label label2;
        private MenuStrip menuStrip1;
        private ToolStripMenuItem 新建文件ToolStripMenuItem;
        private ToolStripMenuItem 打开文件ToolStripMenuItem;
        private ToolStripMenuItem 退出系统ToolStripMenuItem;

        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }
    }
}*/